package com.example.chapter09;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test9 {
    public static void main(String[] args) {
        String text = "张三在周四的早上去肯德基吃了炸鸡.";
        Pattern pattern = Pattern.compile("张三|肯德基");
        Matcher matcher = pattern.matcher(text);
        while (matcher.find()) {
            System.out.println("找到: " + matcher.group());
        }
    }
}
